
{extend name='public/window' /}

{block name="content"}

<div class="layui-fluid">
    <div class="layui-card">
        <!-- <div class="layui-card-header"></div>-->

        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="form">
                {if isset($info.id)}
                <input type="hidden" name="id" value="{$info.id}">
                {/if}
                <input type="hidden" name="__token__" id="token" value="{:token()}"/>

                <div class="layui-form-item">
                    <label class="layui-form-label label-required-next">损耗金额：</label>
                    <div class="layui-input-block input-custom-width" style="">
                        <input type="text" name="money" value="{$info.money}" placeholder="请输入电费损耗金额" lay-verify="required"  autocomplete="off" class="layui-input ">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label label-required-next">损耗电费税率：</label>
                    <div class="layui-input-block input-custom-width" style="">
                        <input type="text" name="rate" value="{$info.rate}" placeholder="请输入损耗电费税率" lay-verify="required"  autocomplete="off" class="layui-input ">
                    %
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启：</label>
                    <div class="layui-input-inline input-custom-width">
                        <input type="radio" name="status" value="1" title="开启" lay-filter=""  {if $info.status} checked {/if}>
                        <input type="radio" name="status" value="0" title="禁用" lay-filter="" {if !$info.status} checked {/if}>
                    </div>
                    <div class="layui-form-mid layui-word-aux"></div>
                </div>
                <div class="layui-form-item layui-layout-admin " style="width: 100%">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0px;text-align: center;">
                            <button class="layui-btn" lay-submit="" lay-filter="add">{:__('Submit')}</button>
                            <button type="reset" class="layui-btn layui-btn-primary">{:__('Reset')}</button>
                        </div>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>


<script>
    layui.use(['element', 'form', 'jquery','authtree','lucky'], function () {
        var element = layui.element;
        var table = layui.table;
        var form = layui.form;
        var $ = layui.jquery;
        var authtree = layui.authtree;
        var lucky=layui.lucky;
        //表单赋值
        var info = {:json_encode($info)};
        form.val("form",info);
        form.on('submit(add)', function (data) {
            lucky.FormSubmit("{:url('index')}",data.field,true);
            return false;
        });
    })
</script>

{/block}

